<?php

namespace App\Http\Controllers\Index;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use Session;
use Config;
use App\Http\Service\User\UserService;

use Illuminate\Support\Facades\Redis;

class IndexController extends Controller
{


    /**
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
     * 首页
     */
    public function home()
    {
        return view("Index.index");
    }

    public function index()
    {
        return view('Index.bussit');
    }

    public function header()
    {
        return view('Index.header');
    }

    public function leftNav()
    {
        return view('Index.sidebar');
    }


    /**
     * @param Request $request
     * 获取用户首页信息
     */
    public function getIndexInfo(Request $request)
    {
        $where = [];
        $where['token'] = Session::get(config::get('custom.setting.MEMBER_TOKEN'));
        $user = new UserService();
        $data =$user->getIndexInfo($where);

        return $data;

    }


    /**
     * @param Request $request
     * @return bool|mixed|string
     * 地区列表
     */
    public function getAreaList(Request $request)
    {
        $where = [];
        $where = $request->all();
        $where['token'] = Session::get(config::get('custom.setting.MEMBER_TOKEN'));
        $user = new UserService();
        $data =$user->getAreaList($where);


        return $data;

    }

    /**
     * @param Request $request
     * @return bool|mixed|string
     * 即将到期列表
     */
    public function getExpiredList(Request $request)
    {
        $where = [];
        $where = $request->all();
        $where['token'] = Session::get(config::get('custom.setting.MEMBER_TOKEN'));
        $user = new UserService();
        $data =$user->getExpiredList($where);


        return $data;

    }

    /**
     * @param Request $request
     * @return bool|mixed|string
     * 余额不足列表
     */
    public function getNoBalanceList(Request $request)
    {
        $where = [];
        $where = $request->all();
        $where['token'] = Session::get(config::get('custom.setting.MEMBER_TOKEN'));
        $user = new UserService();
        $data =$user->getNoBalanceList($where);


        return $data;

    }


    



}
